#pragma once

#include <stdio.h>

#define MAX_SIZE 1024

#define LINE_FLUSH 0
#define NONE_FLUSH 1
#define FULL_FLUSH 2

typedef struct IO_FILE 
{
    int fileno;
    int flag;
    char outbuffer[MAX_SIZE];
    int outbufferlen;
    int flush_method;
}MyFile;

MyFile* myOpen(const char* path, const char* mode);

void myClose(MyFile* file);

int myFwrite(void* str, size_t size, size_t n, MyFile* file);

void myFflush(MyFile* file); 
